package com.magina.mq.listener;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

@Component
public class TopicListener {

    @Value("${act.topicName}")
    private String actTopicName;

    @JmsListener(destination = "${act.topicName}", containerFactory = "jmsListenerContainerTopic")
    public void receive(String text){
        String resultStr  = "ActiveMq:"+actTopicName+" consumer 收到一条信息: " + text;
        System.out.println(resultStr);
    }
}
